#ifndef __regex_base_hpp
#define __regex_base_hpp
#include "bObject.h"
#include "bArray.h"
#include "bChunk.h"
#ifndef null
#define null nullptr
#endif
namespace Regex
{
	//const bool greedy = true;//What is 'greedy' again? oyea, match as many as possible. how silly.
	const bool caseSensitive = false;
	typedef unsigned long int Position;
	class Regex;
	class Result;
	class Chunk;
	class Result:public bObject
	{
		const bool __sucess;
		const unsigned long int __len;
	public:
		Result(bool b,const unsigned long int l):__sucess(b),__len(l){}
		operator const bool () const { return __sucess;}
		operator const unsigned long int () const { return __len; }
	};
	class Regex:public bObject
	{
	protected:
		unsigned long int findChar(const char*,const char,unsigned long int);
	private:
		bArray<Chunk> chunks;
	public:
		const Result match(const char*,bool=false);
		Regex(const char*);
		~Regex(void);
	};
}
#endif